home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15048 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  49 lines

  1. Path: grimsel.zurich.ibm.com!usenet
  2. From: wgk@zurich.ibm.com (Keith Whittingham)
  3. Newsgroups: comp.lang.c++,gnu.g++.help
  4. Subject: Re: Unable to compile inline functions
  5. Date: 3 Apr 1996 09:54:35 GMT
  6. Organization: IBM Research, ZRH
  7. Distribution: world
  8. Message-ID: <4jthsr$34f@grimsel.zurich.ibm.com>
  9. References: <4js108$pm4@ncar.ucar.edu>
  10. Reply-To: wgk@zurich.ibm.com
  11. NNTP-Posting-Host: pine.zurich.ibm.com
  12. X-Newsreader: IBM NewsReader/2 v1.00
  13.  
  14. In <4js108$pm4@ncar.ucar.edu>, jadams@sage.cgd.ucar.edu (James Adams) writes:
  15. >Hello,
  16. >class nrifframe {
  17. >  private:
  18. >        // private member variables
  19. >        int     count;
  20. >        char    *filename;
  21. >        FILE    *infile;
  22. >        header  *head;
  23. >        pix48   *data;
  24. >  public:
  25. >        // public member functions
  26. >        nrifframe ();
  27. >        ~nrifframe ();
  28. >        bool    initialize (char *name);
  29. >        int     getwidth ();
  30. >        int     getheight ();
  31. >};
  32. >
  33. >I have defined the inline functions (in another file) as such:
  34. >
  35. >inline int nrifframe::getheight()
  36. >{
  37. >  return(this->head->y);
  38. >}
  39. >
  40. The compiler doesn't know it's inline... Try either:
  41.  
  42.      public:
  43.        inline int getheight() { return head->y; }
  44.  
  45. or put the inline defs below the class definition in the same file.
  46.  
  47. Keith
  48.  
  49.